package com.gxa.day2022_07_20;

public class Account {
    private String id;//卡号
    private String pwd;//密码
    private double balance;//余额

    public Account(String id,String pwd,double balance){
        this.id =id;
        this.pwd =pwd;
        this.balance = balance;
    }
    public Account(){

    }

    //存钱
    public void save(double money){
        this.balance += money;
    }
//    取钱
    public void get(double money){
//        if() TODO
        if(this.balance<money){
            System.out.println("余额不足");
            return;
        }
        this.balance -=money;
    }

    public Account(String id, String pwd) {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }
}
